#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n;
	int num;
	long r[100005]={0};
	long a[100005]={0};
	cin>>n;
	num=n;
	for(int i=1;i<=n;i++){
		cin>>r[i];
	} 
	sort(r+1,r+n+1);
	int q=0;
	int aaa=0;
	for(int i=1;i<=n;i++){
		
		if(r[i]==q){
			a[aaa]++;
		}
		else{
			aaa++;
			q=r[i];
			a[aaa]++;
		}
	}
	int low=0;
	//for(int i=0;i<=aaa;i++)cout<<a[i]<<" ";
	//cout<<endl;
	for(int i=0;i<=aaa;i++){
		if(low==0){
			low+=a[i];
		}
		else if(low<=a[i]){
			num-=low;
			low=a[i];
		}
		else{
			num-=a[i];
		}
		//cout<<low<<" "<<num<<endl;
	}
	cout<<num;
	return 0;
}
